package com.mc.service.did.impl;

import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import com.mc.dao.LeafIdDao;
import com.mc.pojo.po.LeafIdPO;

@Service
public class DbData {

	private LeafIdDao leafIdDao;
	
	public DbData(LeafIdDao leafIdDao) {
		this.leafIdDao = leafIdDao;
	}

	public LeafIdPO getDb(String bizTag) {
		return leafIdDao.getByBizTag(bizTag);
	}

	@Transactional(rollbackFor = Exception.class)
	public Integer updateDb(Long maxId, String bizTag, Integer version) {
		return leafIdDao.updateByBizTag(bizTag, maxId, version);
	}
	
}
